/*
 * Famon (http://code.google.com/p/famon/)
 * Copyright (c) 2010 Carl Crous.
 *
 * This file is part of Famon.
 *
 * Famon is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Famon is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with Famon.  If not, see <http://www.gnu.org/licenses/>.
 */

package za.org.foobar.famon.frontend.client;

import com.google.gwt.user.client.rpc.AsyncCallback;
import org.gwtportlets.portlet.client.WidgetFactory;
import za.org.foobar.famon.frontend.client.dto.ApplicationDto;
import za.org.foobar.famon.frontend.client.dto.CModelObjectSuggestion;

/**
 * Async version of FamonService.
 */
public interface FamonServiceAsync {

    /**
     * Load the root layout for our application and the page for the
     * history token.
     */
    void getRootPage(String historyToken,
            AsyncCallback<FamonPage> async);

    /**
     * Load a page for the history token.
     */
    void getPage(String historyToken, AsyncCallback<FamonPage> async);

    /**
     * Update the page layout.
     */
    void savePage(String pageName, WidgetFactory wf, AsyncCallback async);

    /**
     * Refresh the factory with new data from the server.
     */
    void refresh(String historyToken, WidgetFactory wf,
            AsyncCallback<WidgetFactory> async);

    public void newPage(String page, AsyncCallback async);

    public void getPageXml(String page, AsyncCallback<String> async);

    public void setPageXml(String page, String value, AsyncCallback async);

    public void getModelObjects(
            String dbClassName, String dbValueField, String dbWhere,
            String query, AsyncCallback<CModelObjectSuggestion[]> async);

    public void updateApplication(ApplicationDto application, AsyncCallback async);

    public void deleteApplication(String applicationId, AsyncCallback async);
}

